import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { Student } from './student.entity';

@Entity()
export class Classroom {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ type: 'varchar', length: 20, unique: true })
  class_id: string;

  @Column()
  name: string;

  @OneToMany(() => Student, student => student.classroom)
  students: Student[];
}